home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: newsfeed.acns.nwu.edu!ftpbox!mothost!mdisea!pilchuck!news
- From: Meiyu Lin <linm@data-io.com>
- Subject: Re: Virtual Function in private part?
- X-Nntp-Posting-Host: inet-gw
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <311A6327.188@data-io.com>
- Sender: news@data-io.com (Usenet news)
- Content-Transfer-Encoding: 7bit
- Organization: Data I/O Corp.
- References: <4f7s5g$ntt@mcmail.CIS.McMaster.CA>
- Mime-Version: 1.0
- Date: Thu, 8 Feb 1996 20:55:03 GMT
- X-Mailer: Mozilla 2.0b6a (Win95; I)
-
- Hong Shen wrote:
- >
- > Is there any reasons to make a member function in the private section of
- > a class virtual?
- >
- > Thanks.
- >
- > Hong ShenA virtual function is a special member function invoked through a public
- base class reference or pointer, It's bound dynamically at run time.
- The base class virtual function serves as a kind of placeholder for
- as-yet undertermined derived class types. Since no one else but the
- class itself can access the private member, so there is no reasons to
- make a member function in the private section of a virtual function.
- This is just my "HOP"
-
- Happy coding.
-
- Meiyu
-